﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity;
using System.Web.Security;
using Business.IManager;
using Business.Manager;
using Entity;
using Utility;

namespace OnlinePayment
{
    public partial class Default : System.Web.UI.Page
    {
        IAccountManager accountManager = new AccountManager();

        protected void Page_Load(object sender, EventArgs e)
        {


        }

        protected void lnkLogin_Click(object sender, EventArgs e)
        {
            
            string code = txtYzm.Text.ToLower().ToString().Trim();
            txtYzm.Text = Session["code"].ToString();


            
                Student studentLogin = new Student();
                studentLogin.StudentId = "123012010196";
                studentLogin.Password = "123012010196";
                Session["User"] = studentLogin;
                Response.Redirect("OP/Index.aspx");
               //studentLogin.Password = FormsAuthentication.HashPasswordForStoringInConfigFile("12345", "md5");

             /* if ((studentLogin=accountManager.logIn(studentLogin))!=null) //判断拥有该用户名和密码的用户是否存在
              {
                    Session["User"] = studentLogin;
                    Response.Redirect("OP/Index.aspx");
                    
             }*/
               
                    //提示不存在这样的用户（用户名或者密码出错）
              


            /*if (Session["code"].ToString().Equals(code))   //验证验证码
            {
                Student studentLogin = new Student();
                studentLogin.StudentId = txtName.Value.ToString();
                studentLogin.Password = txtPwd.Value.ToString(); //FormsAuthentication.HashPasswordForStoringInConfigFile(txtPwd.Value.ToString(), "md5");
                //UtilityClass.MessageBox(studentLogin.StudentId + "|" + studentLogin.Password);
                if (accountManager.logIn(studentLogin)!=null) //判断拥有该用户名和密码的用户是否存在
                {
                    Session["User"] = studentLogin;
                    Response.Redirect("OP/Index.aspx");
                }
            }
            */
        }











    }
}